import Vue from 'vue'
import VueRouter from 'vue-router'
import HasNavigation from "../layout/HasNavigation"

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/home',
    name: 'Home',
    component: () => import('../views/Home.vue')
  },
  {
    path: '/login',
    name: 'Login',
    meta: {
      auth: false,
    },
    component: () => import(/* webpackChunkName: "about" */ '../views/Login.vue')
  },
  {
    path: '/warehousing',
    component: HasNavigation,
    children: [
      {
        path: ':type',
        component: () => import('../views/Warhouse/Warehousing.vue'),
        // meta: {
        //   keepAlive: true
        // }
      },
    ]
  },
  {
    path: '/ordernumber',
    meta: {
      title: '单据信息-调拨',
    },
    component: () => import('../views/Warhouse/OrderNumber.vue')
  },
  {
    path: '/ordernumpo',
    meta: {
      title: '单据信息-PO'
    },
    component: () => import('../views/PO/OrderNumPO.vue')
  }, {
    path: '/orderreturn',
    meta: {
      title: '单据信息-退货'
    },
    component: () => import('../views/ReturnGood/OrderReturn')
  },
  {
    path: '/orderstock',
    meta: {
      title: '单据信息-盘存'
    },
    component: () => import('../views/Stocktake/OrderStock.vue')
  },
  // 打印界面
  {
    path: '/print',
    component: () => import('../views/Print.vue')

  },
  // {
  //   path: '/detailpo',
  //   meta: {
  //     title: '明细'
  //   },
  //   component: () => import('../views/PO/DetailPO.vue')

  // },
  {
    path: '/stocktaking',
    component: HasNavigation,
    children: [
      {
        path: ':type',
        component: () => import('../views/Stocktake/Stocktaking.vue')
      },
    ]
  },
  {
    path: '/putinstorage',
    component: HasNavigation,
    children: [
      {
        path: ':type',
        component: () => import('../views/PO/Putinstorage.vue'),
        // meta: {
        //   keepAlive: true
        // }
      },
    ]
  },
  {
    path: '/backhouse',
    component: HasNavigation,
    children: [
      {
        path: ':type',
        component: () => import('../views/Backhouse.vue'),
      },
    ]
  },
  {
    path: '/temporary',
    component: HasNavigation,
    children: [
      {
        path: ':type',
        component: () => import('../views/Temporary.vue'),
      },
    ]
  },
  {
    path: '/selfdelivery',
    component: HasNavigation,
    children: [
      {
        path: ':type',
        component: () => import('../views/Selfdelivery/Selfdelivery.vue'),
      },
    ]
  },
  {
    path: '/receivestuff',
    component: HasNavigation,
    children: [
      {
        path: ':type',
        component: () => import('../views/Receivestuff.vue'),
      },
    ]
  },
  {
    path: '/returngoods',//po退货
    component: HasNavigation,
    children: [
      {
        path: ':type',
        component: () => import('../views/ReturnGood/Returngoods.vue'),
        // meta: {
        //   keepAlive: true
        // }
      },
    ]
  },
  {
    path: '/putonshelves',
    component: HasNavigation,
    children: [
      {
        path: ':type',
        component: () => import('../views/Putonshelves.vue'),
      },
    ]
  }, {
    path: '/stateadjust',
    component: HasNavigation,
    children: [
      {
        path: ':type',
        component: () => import('../views/Stateadjust.vue'),
      },
    ]
  }, {
    path: '/numberadjust',
    component: HasNavigation,
    children: [
      {
        path: ':type',
        component: () => import('../views/Numberadjust.vue'),
      },
    ]
  }
]

const router = new VueRouter({
  // mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
